package com.googlecode.garbagecan.cxfstudy.type.sample1;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

public class UserServiceImpl implements UserService {

	public Users getUserList() {
		Users users = new Users();
		List<User> userList = new ArrayList<User>();
		for (int i = 0; i < 10; i++) {
			User user = new User();
			user.setId("" + i);
			user.setName("user_" + i);
			user.setPassword("password_" + i);
			userList.add(user);
		}
		users.setUserList(userList);
		return users;
	}

	public Users getUserMap() {
		Users users = new Users();
		Map<String, User> userMap = new LinkedHashMap<String, User>();
		for (int i = 0; i < 10; i++) {
			User user = new User();
			user.setId("" + i);
			user.setName("user_" + i);
			user.setPassword("password_" + i);
			userMap.put(user.getId(), user);
		}
		users.setUserMap(userMap);
		return users;
	}
}
